<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
            "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
	<head>
		<title>hover</title>
        <style type='text/css'>
            body {font-family: verdana}
            .error {border: solid 1px red;}
            .error_text { color: red; font-size: 10px;}
            td {padding: 3px;}
			.hover, .hovers, .hoverleave {
				border: solid 1px green;
				margin:5px;
			}
			.hoverstate {
				background-color: yellow;
			}
			.myhover {
				border: solid 1px red;
			}
        </style>
	</head>
	<body>
<div id='demo-html'>
<h4>Delegating</h4>
<div class='hover'>hover me</div>
<div class='hover'>hover me</div>
<h4>Bound Directly</h4>
<div class='hovers'>hover me for a second</div>
<div class='hovers'>hover me for a second</div>
<h4>HoverLeave</h4>
<div class='hoverleave'>Leave and don't return for a half second</div>
</div>
<script type='text/javascript' 
        src='../../../steal/steal.js'></script>

<script type="text/javascript" id="demo-source">  

steal('jquery/event/hover', function(){

// adds a hover class
var add = function(ev){
  $(this).addClass("hoverstate");
};

// removes a hover class
var remove = function(ev){
  $(this).removeClass("hoverstate");
};

// delegate on hover
$('.hover').live('hoverenter',add);
$('.hover').live('hoverleave', remove);

$('.hovers').bind('hoverinit',function(ev, hovered){
  hovered.delay(1000);
});

$('.hovers').bind('hoverenter',add);
$('.hovers').bind('hoverleave', remove);

$('.hoverleave').bind('hoverinit',function(ev, hovered){
	hovered.leave(500);
}).bind('hoverenter',add).bind('hoverleave', remove);

});

</script>
	</body>
</html>